Optimize remove_child_area for children outside region
authorAlexander Larsson <alexl@redhat.com>
Sun, 19 Jul 2009 20:35:25 +0000 (22:35 +0200)
committerAlexander Larsson <alexl@redhat.com>
Sun, 19 Jul 2009 20:38:06 +0000 (22:38 +0200)
If a child is totally outside the current region, bail early instead
of doing costly calculations to subtract the child region.

gdk/gdkwindow.c

index eeb89325b3e1735ac614eb39767edfe89337de13..a1fa4505df7222669814658f990a1a302f932dbc 100644 (file)
@@ -636,6 +636,10 @@ remove_child_area (GdkWindowObject *private,
       r.width = child->width;
       r.height = child->height;
 
+      /* Bail early if child totally outside region */
+      if (gdk_region_rect_in (region, &r) == GDK_OVERLAP_RECTANGLE_OUT)
+       continue;
+
       child_region = gdk_region_rectangle (&r);
 
       if (child->shape)